package com.huang.exp03.services;

import com.huang.exp03.model.Units;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class SearchServices {
    public List<Units> keyList = new ArrayList<>();
    public List<Units> search(String key){
        for (Units units:InitServices.unitsList){
           // System.out.println(units.getCountry());
            if(key.equals(units.getCountry())){
                keyList.add(units);
            }
        }
       // System.out.println(keyList);
        return keyList;
    }
}
